package com.itheima.test3;

public class goodsTest {
    public static void main(String[] args) {
        //1.创建一个数组
        goods[] arr = new goods[3];

        //2.创建3个商品对象
        goods g1 = new goods("001","huawei",5999,100);
        goods g2 = new goods("002","baowenbei",229,50);
        goods g3 = new goods("003","gouqi",19,70);

        //3。商品添加到数组中
        arr[0] = g1;
        arr[1] = g2;
        arr[2] = g3;

        //4.遍历数组
        for (int i = 0; i < arr.length; i++) {
            goods Goods = arr[i];
            System.out.println(Goods.getId()+","+Goods.getName()+","+Goods.getName()+","+Goods.getPrice()+","+Goods.getPrize()+","+Goods.getPrice());
        }
    }
}
